// 引入axios实例
import { request } from '@/utils/http'
import { Key } from 'react'
import {
  IhospitalListParams,
  IhospitalListResponse,
} from '@api/hospital/model/hospitalListTypes'

// 定义获取医院设置表格数据的函数
export function reqHospitalList(params: IhospitalListParams) {
  const {
    page,
    limit,
    hosname,
    hoscode,
    hostype,
    provinceCode,
    cityCode,
    districtCode,
    status,
  } = params
  // 这里传入IhospitalSetResponse, 是描述响应回来的数据类型
  return request.get<any, IhospitalListResponse>(
    `/admin/hosp/hospital/${page}/${limit}`,
    {
      params: {
        hosname,
        hoscode,
        hostype,
        provinceCode,
        cityCode,
        districtCode,
        status,
      },
    }
  )
}
